<!-- 邀请好友		invite -->
<template>
	<view class="warps">
		<view class="invite-nicheng">
			<view class="">
				<view class="f d c fs28" style="position:relative;top:-90rpx;">
					<image style="width: 196rpx;height: 196rpx;border-radius: 200rpx;" :src="data.img" mode=""></image>
					<text class="mt15">邀请好友注册大王水课~</text>
				</view>
				<view class="senter">
					<image style="width: 272rpx;height: 272rpx;" :src="img" mode=""></image>
				</view>
				<!-- 	<view class="senter p_t_30">
					<text>邀请码</text>
				</view> -->
			</view>
		</view>
		<view class="w90 mt30">
			<view class="f  c flex-center">
				<view
					style="width: 500rpx;height: 80rpx;line-height: 80rpx;border-radius: 24rpx;box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0,0,0,0.16);"
					@click="baocun" class="bg-fff center fs32">保存二维码分享好友</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: [],
				img: ''
			}
		},
		onLoad() {
			// 动态导航条文字
			uni.setNavigationBarTitle({
				title: '邀请好友'
			})
			this.data = uni.getStorageSync('userInfo');
			this.init()
		},
		methods: {
			init() {
				var that = this
				that.$http.post(that.$config.UrlPostusercode, {}).then((res) => {
					if (res.status == 1) {
						that.img = res.data
					}
				})
			},
			baocun() {
				this.$api.downloadImg(this.img)
			}
		}
	}
</script>

<style scoped>
	.warps {
		height: 100vh;
		overflow: hidden;
		background-color: #F6F8FC;
	}

	.invite-nicheng {
		width: 686rpx;
		height: 600rpx;
		opacity: 1;
		background: #ffffff;
		border-radius: 24rpx;
		box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.16);
		margin: 0 auto;
		margin-top: 176rpx;
	}

	.invite-box-ma {
		width: 224rpx;
		height: 42rpx;
		line-height: 42rpx;
		opacity: 1;
		background: #f1f6ff;
		border-radius: 22rpx;
		margin: 0 auto;
		margin-top: 20rpx;
		text-align: center;
		font-size: 24rpx;
		color: #1f73f2;
	}

	.invite-fen {
		width: 328rpx;
		height: 80rpx;
		line-height: 80rpx;
		opacity: 1;
		background: #ffffff;
		border-radius: 12rpx;
		text-align: center;
	}
</style>
